<?php

class Session {

  public static function set($var, $val){
    @session_start();
    $_SESSION[$var] = $val;
  }

  public static function get($var, $default = null){
    @session_start();
    if(!isset($_SESSION[$var]) && !is_null($default)) {
      $_SESSION[$var] = $default;
    }
    return isset($_SESSION[$var]) ? $_SESSION[$var] : $default;
  }

  public static function destroy($var){
    @session_start();
    if(isset($_SESSION[$var])) unset($_SESSION[$var]);
  }

}